#!/bin/bash
# history:
# - create_at: 2024-04-14
# - author: afei@magedu.com
# - description: use to issue a scoped token

OS_TOKEN=gAAAAABmGjmvDoYwjHEHo5QBOPOIdeZ_h-uAZGLOE8sgvIKf74r9G9qT4Ez4SMtppUJdetDpXruz9TyDXGzOfh8cPxo40iFVxx95VIqr9hNWIO8ZTecO15KV_sNSwLdt-qbFYdsEey-eVPQGl6OyE-D4SvIDhq_iNQ

curl -i \
  -H "Content-Type: application/json" \
  -d '
{ "auth": {
    "identity": {
      "methods": ["token"],
      "token": {
        "id": "'$OS_TOKEN'"
      }
    },
    "scope": {
      "project": {
        "name": "admin",
        "domain": {"id": "default"}
      }
    }
  }
}' \
  "http://192.168.31.240:5000/v3/auth/tokens" ; echo
